package com.service.impl;

import com.bean.Type;
import com.dao.TypeMapper;
import com.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeMapper typeMapper;

    @Override
    public int save(Type type) {
        return typeMapper.insert(type);
    }

    @Override
    public int remove(Type type) {
        return typeMapper.delete(type);
    }

    @Override
    public int modify(Type type) {
        return typeMapper.update(type);
    }

    @Override
    public List<Type> find(Type type) {
        return typeMapper.select(type);
    }

    @Override
    public int count(Map<String, Object> map) {
        return typeMapper.selectCount(map);
    }

    @Override
    public List<Type> query(Map<String, Object> map) {
        return typeMapper.selectByPage(map);
    }
}
